package controllers

import (
	"github.com/gin-gonic/gin"
	"github.com/goAdminMicroService/internal/app/details/services"
	"go.uber.org/zap"
	"net/http"
)

type DetailsController struct {
	logger  *zap.Logger
	service services.DetailsService
}

func NewDetailsController(logger *zap.Logger, s services.DetailsService) *DetailsController {
	return &DetailsController{
		logger:  logger,
		service: s,
	}
}

func (pc *DetailsController) Get(c *gin.Context) {
	p, err := pc.service.Get(1)
	if err != nil {
		return
	}
	c.JSON(http.StatusOK, p)
}
